import Vue from 'vue'
import App from './App.vue'
// 引入vue-router
import VueRouter from 'vue-router'
// 引入
import List from './components/MyGoodsList'
import Search from './components/MyGoodsSearch'
import UserInfo from './components/MyUserInfo'
// 注册全局组件，让Vue使用vue-router
Vue.use(VueRouter)

// 定义路由规则的数组
const routes = [
  {
    path: '/',
    name:'List',
    component: List,
  },
  {
    path: '/search',
    name: 'Search',
    component: Search,
  },
  {
    path: '/userInfo',
    name: 'UserInfo',
    component: UserInfo,
  },
]

// 实例化
const router = new VueRouter({
  routes
})


// 配置全局axios
import axios from 'axios'
// 设置全局请求头
axios.defaults.baseURL = 'https://www.escook.cn'
import 'bootstrap/dist/css/bootstrap.css'
import './assets/fonts/iconfont.css'

// 挂载在Vue原型上
Vue.prototype.$axios = axios

Vue.config.productionTip = false

new Vue({
  router,
  render: (h) => h(App),
}).$mount('#app')
